package com.yupi.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.usercenter.model.domain.Team;
import com.yupi.usercenter.model.domain.User;
import com.yupi.usercenter.model.dto.TeamQuery;
import com.yupi.usercenter.model.vo.TeamJoinRequest;
import com.yupi.usercenter.model.vo.TeamQuitRequest;
import com.yupi.usercenter.model.vo.TeamUpdateRequest;
import com.yupi.usercenter.model.vo.TeamUserVO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author Administrator
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-06-29 21:03:12
*/
public interface TeamService extends IService<Team> {
    /**
     * 添加队伍
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * 搜索队伍
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery, Boolean isAdmin);


    Boolean updateTeam(TeamUpdateRequest team,User loginUser);

    Boolean joinTeam(TeamJoinRequest teamJoinRequest,User loginUser);

    Boolean quitTeam(TeamQuitRequest teamQuitRequest,User loginUser);

    Boolean deleteTeam(Long id, User loginUser);
}
